//
//  MineNoSetTVCell.m
//  Shine
//
//  Created by dllo on 16/3/11.
//  Copyright © 2016年 王斌. All rights reserved.
//

#import "MineNoSetTVCell.h"
#define WIDTHCVCELL self.contentView.frame.size.width
#define HEIGHTCVCELL self.contentView.frame.size.height
@implementation MineNoSetTVCell
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createCell];
    }
    return self;
}

- (void)createCell{
    self.noWeightLabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.noWeightLabel];
    self.personImageView = [[UIImageView alloc] init];
    [self.contentView addSubview:self.personImageView];
    self.buttonSetWeight = [UIButton buttonWithType:UIButtonTypeCustom];
    [self.contentView addSubview:self.buttonSetWeight];
    self.titleWeightLabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.titleWeightLabel];
    [self.titleWeightLabel sizeToFit];
    self.titleWeightLabel.numberOfLines = 2;
    self.titleWeightLabel.text = @"从今天开始记录体重变化吧";
    self.titleWeightLabel.textColor = [UIColor lightGrayColor];
    self.titleWeightLabel.lineBreakMode = UILineBreakModeWordWrap;
    self.imageViewLine = [[UIImageView alloc] init];
    [self.contentView addSubview:self.imageViewLine];
}

- (void)layoutSubviews{
    [super layoutSubviews];

    [self.noWeightLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(10);
        make.top.mas_equalTo(40);
        make.width.mas_equalTo(200);
        make.height.mas_equalTo(30);
    }];

    [self.personImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(10);
        make.top.mas_equalTo(90);
        make.width.mas_equalTo(WIDTHCVCELL/2+30);
        make.height.mas_equalTo(190);
    }];

    [self.buttonSetWeight mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(WIDTHCVCELL-70);
        make.top.mas_equalTo(40);
        make.width.mas_equalTo(50);
        make.height.mas_equalTo(50);
    }];

    [self.titleWeightLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(WIDTHCVCELL/2+60);
        make.top.mas_equalTo(180);
        make.width.mas_equalTo(110);
        make.height.mas_equalTo(60);
    }];
    
    [self.imageViewLine mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(WIDTHCVCELL-70);
        make.top.mas_equalTo(90);
        make.size.mas_equalTo(CGSizeMake(30, 90));
    }];
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    // Configure the view for the selected state
}

@end
